<%inherit file="base.html"/>

<%def name="head()">
<script>
    function deleteOpr(opr_id)
    {
        if(confirm("确认删除吗？"))
        {
            window.location.href = "/opr/delete?opr_id="+opr_id;
        }
    }
</script>
</%def>

<%def name="body()">
<section class="content">
    <div class="box">
    <div class="panel-heading"><i class="fa fa-user-secret"></i> 操作员列表</div>
        <div class="panel-body">
            <div class="container">
                <div class="pull-right bottom10">
                     % if get_cookie('opr_type') == 0: 
                     <a href="/opr/add" class="btn btn-sm btn-default">增加操作员</a>
                     % endif
                </div>

                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>操作员名称</th>
                            <th>操作员姓名</th>
                            <th>操作员类型</th>
                            <th>操作员状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        % for opr in opr_list:
                            <tr>
                                <td>${opr.operator_name}</td>
                                <td>${opr.operator_desc}</td>
                                <td>${oprtype[opr.operator_type]}</td>
                                <td>${oprstatus[opr.operator_status]}</td>
                                </td>
                                <td>
                                    % if opr.operator_type > 0 and get_cookie('opr_type') == 0 :
                                    <a class="opt-btn btn-default"
                                     href="/opr/update?opr_id=${opr.id}">修改</a>
                                    <a class="opt-btn btn-default"
                                     href="javascript:deleteOpr('${opr.id}')">删除</a>
                                    % endif
                                 </td>
                            </tr>
                        % endfor
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    </section>
</%def>